home *** CD-ROM | disk | FTP | other *** search
- //=============================================================================
- //
- // Copyright (C) 1995 by Paul S. McCarthy and Eric Sunshine.
- // Written by Paul S. McCarthy and Eric Sunshine.
- // All Rights Reserved.
- //
- // This notice may not be removed from this source code.
- //
- // This object is included in the MiscKit by permission from the authors
- // and its use is governed by the MiscKit license, found in the file
- // "License.rtf" in the MiscKit distribution. Please refer to that file
- // for a list of all applicable permissions and restrictions.
- //
- //=============================================================================
- //-----------------------------------------------------------------------------
- // MiscBorderCell.M
- //
- // Cell class used by MiscBorderView to manage column headings and row
- // labels for MiscTableScroll.
- //
- //-----------------------------------------------------------------------------
- //-----------------------------------------------------------------------------
- // $Id: MiscBorderCell.M,v 1.1 95/09/27 12:21:21 zarnuk Exp $
- // $Log: MiscBorderCell.M,v $
- // Revision 1.1 95/09/27 12:21:21 zarnuk
- // Initial revision
- //
- //-----------------------------------------------------------------------------
- #import "MiscBorderCell.h"
-
- extern "Objective-C" {
- #import <appkit/Font.h>
- #import <appkit/Text.h>
- #import <dpsclient/wraps.h>
- }
-
- @implementation MiscBorderCell
-
- - initTextCell: (char const*) s
- {
- [super initTextCell:s];
- [self setBordered:NO];
- [self setWrap:NO];
- [self setAlignment: NX_CENTERED];
- [self setFont: [Font boldSystemFontOfSize:12.0 matrix:NX_FLIPPEDMATRIX]];
- return self;
- }
-
-
- - (float) backgroundGray
- {
- return cFlags1.state ? (1.0/6.0) : NX_DKGRAY;
- }
-
-
- - setTextAttributes:textObject
- {
- [super setTextAttributes:textObject];
- [textObject setTextGray:NX_WHITE];
- [textObject setBackgroundGray: [self backgroundGray]];
- return textObject;
- }
-
-
- - drawInside:(NXRect const*)cellFrame inView:controlView
- {
- NXRect r;
- PSsetgray( [self backgroundGray] );
- NXSetRect( &r, NX_X(cellFrame)+2, NX_Y(cellFrame)+2,
- NX_WIDTH(cellFrame) - 3, NX_HEIGHT(cellFrame) - 3 );
- NXRectFill( &r );
- [super drawInside:&r inView:controlView];
- return self;
- }
-
-
- - drawSelf:(NXRect const*)cellFrame inView:aView
- {
- NXRect r[2];
-
- PSsetgray( NX_LTGRAY );
- NXSetRect( &(r[0]), NX_X(cellFrame), NX_Y(cellFrame),
- 1, NX_HEIGHT(cellFrame) );
- NXSetRect( &(r[1]), NX_X(cellFrame) + 1, NX_Y(cellFrame),
- NX_WIDTH(cellFrame) - 1, 1 );
- NXRectFillList( r, 2 );
-
- PSsetgray( NX_WHITE );
- NXSetRect( &(r[0]), NX_X(cellFrame) + 1, NX_Y(cellFrame) + 1,
- 1, NX_HEIGHT(cellFrame) - 2 );
- NXSetRect( &(r[1]), NX_X(cellFrame) + 2, NX_Y(cellFrame) + 1,
- NX_WIDTH(cellFrame) - 3, 1 );
- NXRectFillList( r, 2 );
-
- PSsetgray( NX_BLACK );
- NXSetRect( &(r[0]), NX_MAXX(cellFrame) - 1, NX_Y(cellFrame) + 2,
- 1, NX_HEIGHT(cellFrame) - 2 );
- NXSetRect( &(r[1]), NX_X(cellFrame) + 2, NX_MAXY(cellFrame) - 1,
- NX_WIDTH(cellFrame) - 3, 1 );
- NXRectFillList( r, 2 );
-
- PSsetgray( NX_DKGRAY );
- NXSetRect( &(r[0]), NX_X(cellFrame)+1, NX_MAXY(cellFrame) - 1, 1, 1 );
- NXSetRect( &(r[1]), NX_MAXX(cellFrame) - 1, NX_Y(cellFrame) + 1, 1, 1 );
- NXRectFillList( r, 2 );
-
- return [self drawInside:cellFrame inView:aView];
- }
-
-
- // - highlight:(NXRect const*)cellFrame inView:controlView lit:(BOOL)flag
- // {
- // // if (cFlags1.highlighted != flag)
- // // {
- // // cFlags1.highlighted = flag;
- // // [self drawInside:cellFrame inView:controlView];
- // // }
- // cFlags1.highlighted = flag;
- // [self drawInside:cellFrame inView:controlView];
- // return self;
- // }
-
- @end
-